<!DOCTYPE html>
<html>
		<head>
			<meta charset="UTF-8">
			<meta charset="utf-8">
			<meta http-equiv="X-UA-Compatible" content="IE=edge">
			<meta name="viewport" content="width=device-width, initial-scale=1">
			<title>添加员工信息</title>
			<link rel="shortcut icon" href="assets/ico/favicon.ico" type="image/x-icon" />
			<link href="assets/css/bootstrap.min.css" rel="stylesheet">
			<link href="assets/css/jquery.mmenu.css" rel="stylesheet">
			<link href="assets/css/font-awesome.min.css" rel="stylesheet">
			<link href="assets/plugins/jquery-ui/css/jquery-ui-1.10.4.min.css" rel="stylesheet">
			<link href="assets/plugins/chosen/css/chosen.css" rel="stylesheet">
			<link href="assets/css/style.min.css" rel="stylesheet">
			<link href="assets/css/add-ons.min.css" rel="stylesheet">
		</head>
	<body>

		<div class="row">
			<div class="col-md-6">
				<div class="panel panel-default">
					<div class="panel-heading">
						<h2><i class="fa fa-indent red"></i><strong>添加员工信息</strong></h2>
					</div>
					<div class="panel-body">
						<form action="/addemplyee" method="post" >

							<div class="form-group">
								<label class="col-md-3 control-label" for="text-input">姓名：</label>
								<div class="col-md-9">
									<input type="text" id="text" name="employeename" class="form-control" >
								</div>
							</div>
							
							<div class="form-group">
								<label class="col-md-3 control-label" >身份证号：</label>
								<div class="col-md-9">
									<input type="text"  name="employeeidnumber" class="form-control">
								</div>
							</div>
							
							<div class="form-group">
								<label class="col-md-3 control-label" for="text-input">联系电话：</label>
								<div class="col-md-9">
									<input type="text" id="text-input" name="employeephonenumber" class="form-control">
								</div>
							</div>
							<div class="form-group">
								<label class="col-md-3 control-label">状态</label>
								<div class="col-md-9">
									<div class="radio">
										<label for="radio1">
											<input type="radio" id="radio1" name="status" value="0" checked="checked"> 未离职
										</label>
									</div>
								</div>
							</div>
							<div class="form-group">
								<label class="col-md-3 control-label" for="select">部门名称：</label>
								<div class="col-md-9">
									<select id="select" name="fkdepartmentid" class="form-control" size="1">
										<option >请选择部门信息</option>
										<option value="1">财务部</option>
									</select>
								</div>
							</div>
							
							<div class="form-group">
				                    <label class="col-md-3 control-label">性别：</label>
				                    <div class="col-md-8">
				                        <label class="radio-inline" for="inline-radio1">
				                        	<input type="radio" id="inline-radio1" name="employeesex" value="男"> 男
				                        </label>
				                        <label class="radio-inline" for="inline-radio2">
				                        	<input type="radio" id="inline-radio2" name="employeesex" value="女"> 女
				                        </label>
				                    </div>
				             </div>
							
							
							<div >
								<button type="submit" class="btn btn-sm btn-success"><i class="fa fa-dot-circle-o"></i> 添加</button>
								<button type="reset" class="btn btn-sm btn-danger"><i class="fa fa-ban"></i> 重置</button>
							</div>
						</form>
					</div>
				</div>
			</div>
		</div>
	</body>
		<script src="assets/js/jquery-1.4.1.js"></script>
		<script type="text/javascript">
            $(function(){
                $("input[name=employeename]").bind("blur",function(){
                    //清空
                    $(this).nextAll("span").remove();
                    var Emali=$(this).val();
                    if(Emali==null){
                        //如果不通过就给出提示
                        $("input[name=employeename]").after("<span>姓名不能为空</span>");
                    }
                });

                $("input[name=employeeidnumber]").bind("blur",function(){
                    //清空
                    $(this).nextAll("span").remove();
                    var Emali=$(this).val();
                    if(Emali==null){
                        //如果不通过就给出提示
                        $("input[name=employeeidnumber]").after("<span>联系电话不能为空</span>");
                    }
                });
                
                  $("input[name=fkdepartmentid]").bind("blur",function(){
                    //清空
                    $(this).nextAll("span").remove();
                    var Emali=$(this).val();
                    if(Emali==null){
                        //如果不通过就给出提示
                        $("input[name=fkdepartmentid]").after("<span>部门名称不能为空</span>");
                    }
                });

                //绑定提交事件
                $("form").bind("submit",function(){
                    //让form表单默认执行blur()方法
                    $("form").trigger("blur");
                    //如果span标签有值就表示有错误信息不能提交表单
                    if($("span").length>0){
                        return false;
                    }
                   
                });
            });
		</script>
</html>
